package com.liuyi.netty.im.test.im.listeners;

import com.liuyi.netty.im.commons.codes.data.event.NotReady;
import com.liuyi.netty.im.test.im.client.ChannelStorage;
import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j;

/**
 * 连接未就绪
 * @author Mr.Fmy
 * @since 2022/1/19
 */
@Slf4j
public class ImNotReadyListener extends ImAbstractListener<NotReady>{

    @Override
    public void handler0(Channel channel, NotReady data) {
        ChannelStorage.notReady(channel.id());
    }

    @Override
    public NotReady convert(Object data) {
        if (data instanceof NotReady){
            return (NotReady) data;
        }
        return null;
    }
}
